#ifndef VXANCHOR_H
#define VXANCHOR_H

#include <QtGui>

class VxAnchor : public QObject
{
	Q_OBJECT
public:
	enum Type {
		Standart
	};

	enum ObjectType{
		Widget,
		GraphicsItem
	};

	VxAnchor(QWidget * controlled, QWidget * paper, Type type=Standart);
	VxAnchor(QGraphicsProxyWidget  * controlled, QGraphicsView * paper, Type type=Standart);
	bool eventFilter(QObject *, QEvent *);

private:
	Type _type;
	QWidget * _paperw;
	QWidget * _objectw;

	QGraphicsView * _paperi;
	QGraphicsProxyWidget * _objecti;


	QPoint _position;
	ObjectType _objectType;
	void _storeObject();

	QPoint _getXY();
	void _setXY(QPoint xy);
	QSize _getPaperSize();

};

#endif // VXANCHOR_H
